package com.mnsq.permission.controller;

import com.mnsq.common.controller.BaseController;
import com.mnsq.common.service.BaseService;
import com.mnsq.permission.bean.condition.MenuCondition;
import com.mnsq.permission.bean.entity.Menus;
import com.mnsq.permission.service.MenuService;
import com.vwkit.common.bean.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 周俭
 */
@Api("sth. about the menu")
@RestController
@RequestMapping("/api/sys/menu")
public class MenuController extends BaseController<Menus, BaseService<Menus, MenuCondition>, MenuCondition> {

    @Autowired
    private MenuService menuService;

    @ApiOperation(value = "find the info of menu", notes = "unique string")
    @GetMapping("findNavTree")
    public Result queryMenu(String userUnique) {
        MenuCondition menuCondition = new MenuCondition();
        menuCondition.setUnique(userUnique);
        return Result.success(menuService.queryListByCondition(menuCondition));
    }
}
